import 'package:get/get.dart';
import 'package:sweetim/main.dart';
import 'package:sweetim/model/chat_record.dart';
import 'package:sweetim/service/api_service.dart';
import 'package:sweetim/service/member_service.dart';

import '../const/const.dart';

class ChatService extends GetxService {
  
  final ApiService _apiService = Get.find();
  final MemberService _memberService = Get.find();
  
  Future<List<ChatRecord>> queryChatRecord() async {
    var resp = await _apiService.get0(queryChatRecordListUrl, _memberService.token);
    List<dynamic> list = resp["list"];
    return list.map((e) => ChatRecord.fromJson(e)).toList();
  }

}